package net.arogarth.aws.android.manager.dbmodels;

import java.util.List;

public abstract class DbObject {
	/**
	 * Return a list of all objects of this type
	 * @return List<?>
	 */
	public List<?> listAll() {
		return list("");
	}
	
	/**
	 * Return a single object given by id
	 * 
	 * @param Integer id
	 * @return DbObject
	 */
	public abstract DbObject load(Long id);
	
	/**
	 * Return a list of objects filtered by where-clause
	 * 
	 * @param String where
	 * @return List<?>
	 */
	public abstract List<?> list(String where);
	
	/**
	 * Save the object as new item or update it
	 * 
	 * If the id is null it will create a new record
	 * othweise it will update the record with this id
	 */
	public abstract void save();
	
	/**
	 * Delete the current object
	 */
	public abstract void delete();
}
